package com.share.three.g_jmx;

import org.springframework.jmx.export.annotation.ManagedAttribute;
import org.springframework.jmx.export.annotation.ManagedOperation;
import org.springframework.jmx.export.annotation.ManagedResource;
import org.springframework.stereotype.Service;

@ManagedResource
@Service
public final class MBean {
	
	private int age = 10;

	@ManagedAttribute
	public int getAge() {
		return age;
	}

	@ManagedAttribute
	public void setAge(int age) {
		this.age = age;
	}
	

	@Override
	@ManagedAttribute
	public String toString() {
		return "MBean [age=" + age + "]";
	}

	@ManagedOperation
	public void print(String arg) {
		System.out.println("hello : " + arg);
	}
}
